layui.use(['upload', 'element', 'layer', 'table', 'form'], function () {
  var upload = layui.upload
    , $ = layui.$
    , layer = layui.layer
    , element = layui.element
    , table = layui.table
    , form = layui.form;

  // from
  form.on('submit(jsonFormSubmit)', function (data) {
    //layer.msg(JSON.stringify(data.field));
    var urls = jsRoutes.controllers.user.KisStockStoreNowController.show();
    table.render({
      elem: '#demoTable'
      , where: data.field
      , headers: { "Csrf-Token": $('[name="csrfToken"]').val() }
      , contentType: 'application/json'
      , method: urls.method
      , height: 710
      , url: urls.url //数据接口
      , page: true //开启分页
      , limits: [10, 20, 50, 100,500,1000]
      , toolbar: 'default'
      , cols: [[ //{"id":57003451,"ar_date":"2022-02-18T00:00:00","ar_id":"AR22022113293","seq":1,"kFMaterial":"A0101001",
        //"kTaxPrice":22.1,"kPriceQty":2,"kFDISCOUNTAMOUNTFOR":0,"kALLAMOUNT":44.2,"user":0,"upDate":"2022-02-18T18:32:39.462267"}
        { field: 'id', title: 'seq', width: 72, sort: true,hide:true }
        , { field: 'kOrgName', title: '组织', width: 210 }
        , { field: 'kStockId', title: '仓库代码', width: 100 }
        , { field: 'kStockName', title: '仓库名称', width: 160 }
        , { field: 'kMaterialId', title: '物料编码', width: 110,sort: true }
        , { field: 'kMaterialName', title: '物料名称', width: 350 }
        , { field: 'kLot', title: '批号', width: 120 }
        , { field: 'kBaseQty', title: '数量', width: 120, align: 'right'}
        , { field: 'status', title: '库存状态', width: 120 }

        //, { field: 'operation', title: '操作', width: 200, align:'center', toolbar: '#barDemo'}
      ]]
    });
    return false;
  });

});